﻿@model WikeSoft.Enterprise.Models.Sys.ChangePasswordModel

@{
    ViewBag.Title = "更改密码";
    Layout = "~/Views/Shared/_Form.cshtml";
    var obj = ViewData["IsPasswordExpirated"];
    DateTime? expiratedDate = null;
    if (ViewData["ExpiratedDate"] != null)
    {
        expiratedDate = (DateTime)ViewData["ExpiratedDate"];
    }

    var isPasswordExpirated = Convert.ToBoolean(obj);
}
@section scripts{
   

    @if (ViewBag.Sucess != null)
    {
        <script type="text/javascript">
            top.layer.confirm("密码修改成功，是否重新登录？", {
                btn: ['确认', '取消'] //按钮
            }, function () {
                window.location.href = "/Home/Logout";
            }, function () {

            });
        </script>
    }
}

@if (isPasswordExpirated)
{

    if (expiratedDate != null)
    { <div class="alert alert-danger" role="alert">
            @string.Format("您之前的密码已于{0}过期，请修改密码！", expiratedDate.Value.ToString("yyyy-MM-dd HH:mm:ss"))
        </div>
    }


}
<form class="form-horizontal" action="@Url.Action("ChangePassword")" method="post">
    <div class="form-group">
        @Html.LabelFor(x => x.OldPassword, new { @class = "col-sm-2 control-label" })
        <div class="col-sm-10">
            @Html.PasswordFor(x => x.OldPassword, new { @class = "form-control", placeholder = "" })
            @Html.ValidationMessageFor(x => x.OldPassword)

        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(x => x.Password, new { @class = "col-sm-2 control-label" })
        <div class="col-sm-10">
            @Html.PasswordFor(x => x.Password, new { @class = "form-control", placeholder = "" })
            @Html.ValidationMessageFor(x => x.Password)

        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(x => x.ConfirmPassword, new { @class = "col-sm-2 control-label" })
        <div class="col-sm-10">
            @Html.PasswordFor(x => x.ConfirmPassword, new { @class = "form-control", placeholder = "" })
            @Html.ValidationMessageFor(x => x.ConfirmPassword)

        </div>
    </div>

    <div>
        <div style="text-align: center">
            <button class="btn btn-default" type="submit" action="submit">修改密码</button>
             
        </div>

    </div>
</form>

